package Controls
{
	import Objects.GameSprite;

	public class ChekBox extends Interactive
	{
		public var label:Label;
		public function ChekBox()
		{
			super();
			label=new Label();
			addChild(label);
		}
		override protected function $update():void
		{
			super.$update();
			
			if(mHit)
			{
				selected=!selected;
			}
		}
		public function setLabel(text:String,html:Boolean=false,spacingH:int=5):void
		{
			if(html)
			{
				label.textField.htmlText=text;
			}
			else
			{
				label.textField.text=text;
			}
			layout(spacingH);
		}
		protected function layout(spacingH:int):void
		{
			label.moveTo(image.obj.width+spacingH,image.obj.height/2,0,0.5);
		}
	}
}